<?php

namespace app\admin\system;

use app\BaseController;
use think\Request;
use modules\setting\services\SettingService;
use modules\setting\services\impl\SettingServiceImpl;
class Menu extends BaseController
{
    protected $settingService;
    public function __construct(SettingService $settingService)
    {
        $this->settingService = $settingService;
    }
    /**
     * 显示资源列表
     *
     * @return \think\Response
     */
    public function index()
    {
        $this->settingService->addSetting([
            'name' => 'menu',
            'value' => '菜单',
            'type' => 'text',
            'json_value' => '[]',
            'description' => '菜单',
        ]);
        return $this->settingService->getSettingList();
    }

    /**
     * 保存新建的资源
     *
     * @param  \think\Request  $request
     * @return \think\Response
     */
    public function save(Request $request)
    {
        //
    }

    /**
     * 显示指定的资源
     *
     * @param  int  $id
     * @return \think\Response
     */
    public function read($id)
    {
        return 'user read id of ' . $id;
    }

    /**
     * 保存更新的资源
     *
     * @param  \think\Request  $request
     * @param  int  $id
     * @return \think\Response
     */
    public function update(Request $request, $id)
    {
        //
    }

    /**
     * 删除指定资源
     *
     * @param  int  $id
     * @return \think\Response
     */
    public function delete($id)
    {
        //
    }
}
